package org.achievement.system.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.achievement.system.common.RequestResult;
import org.achievement.system.dao.RoleDao;
import org.achievement.system.pojo.entity.Role;
import org.achievement.system.service.RoleService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/role")
public class RoleController {


    @Autowired
    private RoleService roleService;

    @Autowired
    private RoleDao roleDao;

    /**
     * 获取角色列表
     *
     * @return
     */
    @RequestMapping("/list")
    public RequestResult getRoleList() {
        List<Role> roles = roleDao.selectList(new QueryWrapper<>());
        return RequestResult.success(roles);
    }


}